<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>FormFactory Test</title>
	<style type="text/css">
		@import "../../../dojo/dojo/resources/dojo.css";
        @import "../resources/toaster.css";
        @import "../../../dojo/dijit/themes/nihilo/nihilo.css";;		
	</style>
	
	<script type="text/javascript" src="../../../dojo/dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("dojo.parser");
		dojo.registerModulePath("qDojo", "../../qDojo");
		
		dojo.require("qDojo.dijix.FormFactory");		
		dojo.require("dijit.layout.BorderContainer");		
		dojo.require("dijit.form.Button"); 
		dojo.require("dijit.Dialog"); 
		dojo.require("qDojo.dijix.CssRounded"); 
		
		var doThis = function (){
			console.log("Where u gonna run to?");
			var a = new dijit.Dialog({id:"mydlg", title:"Form in a dialog"});			
			
			var s = [	{ name:'Id', type:'number' , readOnly:false , value:2 , min:1 , max:12 , places:0 , required:true},							   		
				   		{ name:'Description' , 	type:'text', required:true , lang:'both'},
				   		{ name:'E-Mail' , 	type:'email'},
				   		{ name:'Joined Date' , 	type:'date' , value:'1 1,2009'} ];
		
			var b = new qDojo.dijix.FormFactory( {formId:"ad" , viewName:"me" , formStruct: s , cancelAction:"dijit.byId('"+a.id+"').destroy()" , submitAction:"dijit.byId('"+a.id+"').destroy()" } );
			a.setContent(b.domNode);
			a.show();
		};
		
	</script>
</head>
<body class="nihilo">

<div id='myform' dojoType="qDojo.dijix.FormFactory" region="center" style="width:422px"></div>		
<div id="mybtt" dojoType="dijit.form.Button" label="In Dialog" onClick="doThis()"></div>		
</body>
</html>